package JAVA克隆;

import 对象引用.Entity;

import java.util.Objects;

/**
 * 项目名称：Demo01
 * 类 名 称：CloneEntity
 * 类 描 述：TODO
 * 创建时间：2021/03/15 14:34
 * 创 建 人：XiaoCoder
 */
public class CloneEntity implements Cloneable {

    private int id;
    private String name;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        CloneEntity entity = null;
        try {
            entity = (CloneEntity) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return entity;
    }
}
